package com.iplant.mes.service;

import com.iplant.ams.service.po.dms.DMSDeviceLedger;
import com.iplant.ams.service.po.dms.scada.conf.DMSDeviceParameter;
import com.iplant.ams.service.po.dms.scada.record.DMSProcessRecord;
import com.iplant.base.po.OutResult;
import com.iplant.base.po.Pagination;
import com.iplant.base.po.ServiceResult;
import com.iplant.basic.service.po.bms.BMSEmployee;
import com.iplant.mes.service.po.ipt.IPTValue;
import com.iplant.mes.service.po.print.SFCFactoryTest;
import com.iplant.mes.service.po.sfc.*;
import com.iplant.mes.service.po.sfc.frockBind.SFCBindComponent;
import com.iplant.mes.service.po.sfc.workpieceRecord.SFCExportHead;
import com.iplant.pdm.service.po.bop.FPCRoutePartPoint;

import java.util.Calendar;
import java.util.List;
import java.util.Map;

public interface SFCFrockBindService {

    ServiceResult<SFCTaskSelf> SFC_GetWorkOrderByComponentCode(BMSEmployee wLoginUser, String wComponentCode,
                                                               List<SFCTaskSelf> wSFCTaskSelfList);

    ServiceResult<Integer> SFC_TrayBindingWorkOrder(BMSEmployee wLoginUser, String wTrayCode,
                                                    List<SFCBindComponent> wSFCBindComponentList, int wStatus);

    ServiceResult<String> SFC_ExportDeviceRecord(BMSEmployee wLoginUser, String wWorkpieceNo, int wRoutePartID,
                                                 int wRoutePartPointID, int wDeviceID, List<SFCExportHead> wHeadList,
                                                 String wDeviceName);

    void UpdateWorkpieceRelaCode(BMSEmployee wLoginUser, List<SFCAssemblyRecord> wToBindList);

    void SFC_WorkpieceRecordSubScrap(BMSEmployee wLoginUser, SFCWorkpieceRecord wSFCWorkpieceRecord,
                                     OutResult<Integer> wErrorCode);

    ServiceResult<List<SFCTaskSelf>> SFC_QueryTaskListByTrayAndStation(BMSEmployee wLoginUser, String wTrayCode,
                                                                       int wStationID);

    ServiceResult<SFCWorkpieceRecord> SFC_QueryProductInfoByTray(BMSEmployee wLoginUser, String wTrayCode,
                                                                 String wMouldCode);

    ServiceResult<SFCTaskStartCheck> SFC_QueryTaskStartCheckInfo(BMSEmployee wLoginUser, int wID);

    ServiceResult<List<SFCFrockBindRecord>> SFC_QueryFrockBindRecordAll(BMSEmployee wLoginUser,
                                                                        Map<String, Object> wParams,
                                                                        Pagination wPagination);

    ServiceResult<String> SFC_GetComponentTypeByBarCode(BMSEmployee wLoginUser, String wBarCode);

    ServiceResult<Integer> SFC_AutoAssembly(BMSEmployee wLoginUser, SFCTaskSelf wSFCTaskSelf, String wTrayCode,
                                            OutResult<Integer> wErrorCode);

    ServiceResult<List<SFCTaskSelf>> SFC_QuerySFCTaskSelfAll(BMSEmployee wLoginUser, Map<String, Object> wParams,
                                                             Pagination wPagination);

    ServiceResult<String> SFC_ExportFactoryTest_V1(BMSEmployee wLoginUser, SFCFactoryTest wSFCFactoryTest);

    ServiceResult<String> SFC_GetProductCodeByBarCode(BMSEmployee wLoginUser, String wSourceCodes);

    ServiceResult<Integer> SFC_UpdateDayPlanFirstCheckStatus(BMSEmployee wLoginUser, SFCTaskSelf wSFCTaskSelf,
                                                             FPCRoutePartPoint wFPCRoutePartPoint);

    ServiceResult<Integer> SFC_SubmitDayPlanFirstCheckStatus(BMSEmployee wLoginUser, List<SFCTaskIPT> sfcTaskIPTs);

    ServiceResult<List<SFCWorkpieceRecord>> SFC_QueryComWorkpieceRecordList(BMSEmployee wLoginUser,
                                                                            SFCWorkpieceRecord wSFCWorkpieceRecord);

    ServiceResult<Integer> SFC_UpdateStationMaterialList(BMSEmployee wLoginUser,
                                                         List<SFCStationMaterial> wSFCStationMaterialList,
                                                         SFCTaskSelf wSFCTaskSelf);

    ServiceResult<SFCTaskIPT> SFC_CreateSpotCheckTaskByWorkpieceNoAndTask(BMSEmployee wLoginUser, String wWorkpieceNo
            , SFCTaskSelf wSFCTaskSelf);

    ServiceResult<List<SFCTaskParamItem>> SFC_ChangeParamList(BMSEmployee wLoginUser,
                                                              List<DMSProcessRecord> wDMSProcessRecordList,
                                                              List<DMSDeviceParameter> wDMSDeviceParameterList);

    ServiceResult<Integer> SFC_ReplacementJobCode(BMSEmployee wLoginUser, int wSFCAssemblyRecordID, String wNewJobCode);

    ServiceResult<List<DMSProcessRecord>> SFC_QueryrocessRecordListByWorkpieceCode(BMSEmployee wLoginUser,
                                                                                   SFCWorkpieceRecord wSFCWorkpieceRecord);

    ServiceResult<List<SFCTaskSelf>> SFC_QuerHistoryStartTaskSelfList(BMSEmployee wLoginUser, int shiftType,
                                                                      List<Integer> stationIDList, int wIsUserAll);

    ServiceResult<Integer> SFC_FinishSameSelfTask(BMSEmployee wLoginUser, SFCTaskSelf wSFCTaskSelf);

    ServiceResult<Integer> SFC_DeleteTaskReport(BMSEmployee wLoginUser, SFCTaskReport wSFCTaskReport);

    ServiceResult<List<DMSDeviceLedger>> SFC_QueryDeviceListByWorkstation(BMSEmployee wLoginUser, int wStationID);

    ServiceResult<List<SFCTaskReport>> SFC_QueryStatistics(BMSEmployee wLoginUser, Calendar wStartTime,
                                                           Calendar wEndTime, int wReporterID, String wOrderNo,
                                                           int wProductID, int wStationID);

    ServiceResult<Integer> IPT_UpdateValueList(BMSEmployee wLoginUser, List<IPTValue> wIPTValueList);

    ServiceResult<Integer> SFC_UpdateProgressByReportTask(BMSEmployee wLoginUser, int wTaskReportID);

    ServiceResult<List<SFCStationInterfaceLog>> SFC_QueryStationInterfaceLogAll(BMSEmployee wLoginUser, int wStationID, String wInterfaceType);

    ServiceResult<SFCTaskIPT> SFC_CreateReCheckTaskByWorkpieceNoAndTask(BMSEmployee wLoginUser, String wWorkpieceNo, SFCTaskSelf wSFCTaskSelf);

    ServiceResult<SFCWorkpieceExportRecord> SFC_ExportWorkpieceRecord(BMSEmployee wLoginUser, Map<String, Object> wParams);
}
